package com.swancloud.api.compute.ext;

import java.util.List;

import com.swancloud.common.RestService;
import com.swancloud.model.common.ActionResponse;
import com.swancloud.model.compute.ext.Migration;
import com.swancloud.model.compute.ext.MigrationsFilter;

/**
 * API which supports the "os-migrations" extension.
 *
 * @author Jeremy Unruh
 */
public interface MigrationService extends RestService {

    /**
     * Administrators only. Fetch in-progress migrations for a region or a specified cell in a region.
     *
     * @return in-progress migrations or empty list
     */
    List<? extends Migration> list();

    /**
     * Administrators only. Fetch in-progress migrations for a region or a specified cell in a region with filtering options
     *
     * @param filter the filter constraints
     * @return in-progress migrations or empty list
     */
    List<? extends Migration> list(MigrationsFilter filter);

    /**
     * Policy defaults enable only users with the administrative role to perform this operation.
     * Show details for an in-progress live migration for a given server.
     * @param serverId
     * @param migrationId
     * @return
     */
    Migration getDetails(String serverId,Integer migrationId);

    /**
     * Policy defaults enable only users with the administrative role to perform this operation.
     * Force an in-progress live migration for a given server to complete.
     * @param serverId
     * @param migrationId
     * @return
     */
    ActionResponse forceCompleteMigration(String serverId, Integer migrationId);
    /**
     * Policy defaults enable only users with the administrative role to perform this operation.
     * Force an in-progress live migration for a given server to complete.
     * @param serverId
     * @param migrationId
     * @return
     */
    ActionResponse delete(String serverId, Integer migrationId);
}
